import os
import subprocess
import sys
print("  ____  _   _                       _   _             _    ")
print(" / __ \| | | |                     | | | |           | |   ")
print("| |  | | |_| |__   ___ _ __    __ _| |_| |_ __ _  ___| | __")
print("| |  | | __| '_ \ / _ \ '__|  / _` | __| __/ _` |/ __| |/ /")
print("| |__| | |_| | | |  __/ |    | (_| | |_| || (_| | (__|   < ")
print(" \____/ \__|_| |_|\___|_|     \__,_|\__|\__\__,_|\___|_|\_\\")
files = {
    1: {"name": "ddos/Other_attack/DNS_Amplification.py", "description": "DNS Amplification"},
    2: {"name": "ddos/Other_attack/RUDY_Attack.py", "description": "RUDY Attack"},
    3: {"name": "ddos/Other_attack/Sip_Register_Flood.py", "description": "SIP Register Flood(Need sippy library)"},
    4: {"name": "ddos/Other_attack/Sip_lnvite_Flood.py", "description": "SIP Invite Flood"},
    5: {"name": "ddos/Other_attack/Smurf_attack.py", "description": "Smurf Attack"},
    6: {"name": "ddos/Other_attack/Replay_Attack.py", "description": "Replay Attack"},
}

def run_python_file(file_number):
    if file_number in files:
        file_info = files[file_number]
        file_name = file_info["name"]
        file_description = file_info["description"]
        if os.path.exists(file_name) and file_name.endswith('.py'):
            print("ok")
            subprocess.run([sys.executable, file_name])
        else:
            print("Error: File does not exist.")
    else:
        print("Error: Invalid selection.")

def main():
    print("Input attack mode：")
    for num, file_info in files.items():
        print(f"[{num}] {file_info['description']}")
    choice = int(input("Please enter the number: "))
    run_python_file(choice)

if __name__ == "__main__":
    main()
    
#sansjtw https://sansjtw.xyz https://github.com/sansjtw